<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>
<body>
    <script>
        var cat = {
            name:"加菲猫",
            arr:['aa',12]
        }

        var str = JSON.stringify(cat);
        console.log(str);
        console.log(cat);
        console.log('====');
        var dogStr = '{"nick":"拉多","age":2}';
        var dog = JSON.parse(dogStr);
        console.log(dog);
    </script>
</body>
</html>